local ty_1v2_xy = fk.CreateSkill {
    name = "ty_1v2_xy&",
    tags = { Skill.Compulsory }
}

Fk:loadTranslationTable {
    ["ty_1v2_xy&"] = "襄阳",
    [":ty_1v2_xy&"] = "锁定技，结束阶段开始时，摸一张牌，然后执行一个额外的出牌或摸牌阶段。",

    ["ty_1v2_xy_drwa"] = "摸牌阶段",
    ["ty_1v2_xy_play"] = "出牌阶段",
}

ty_1v2_xy:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(self) and player.phase == Player.Finish
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        player:drawCards(1, ty_1v2_xy.name)
        local choices = { "ty_1v2_xy_drwa", "ty_1v2_xy_play" }
        local choice = room:askToChoice(player, {
            choices = choices,
            skill_name = ty_1v2_xy.name,
            prompt = "襄阳：请选择要执行的额外阶段"
        })
        player:gainAnExtraPhase(choice == "ty_1v2_xy_drwa" and Player.Draw or Player.Play)
    end,
})

return ty_1v2_xy
